home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Corel 10 Texture (image/corel10Texture)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| x-fmt/111 Plain Text File
| default
| |
100%
| detectItEasy
| Format: Plain text[LF]
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 61 75 74 68 6f 72 20 | 7b 53 76 65 6e 20 47 6f |\author |{Sven Go|
|00000010| 6c 64 74 7d 0a 5c 74 69 | 74 6c 65 20 7b 54 68 65 |ldt}.\ti|tle {The|
|00000020| 20 4c 69 6e 75 78 20 50 | 72 6f 67 72 61 6d 6d 65 | Linux P|rogramme|
|00000030| 72 27 73 20 47 75 69 64 | 65 7d 0a 0a 5c 63 68 61 |r's Guid|e}..\cha|
|00000040| 70 74 65 72 20 7b 50 72 | 6f 67 72 61 6d 6d 69 6e |pter {Pr|ogrammin|
|00000050| 67 20 49 2f 4f 20 70 6f | 72 74 73 7d 0a 0a 55 73 |g I/O po|rts}..Us|
|00000060| 75 61 6c 6c 79 20 61 20 | 50 43 20 61 74 20 6c 65 |ually a |PC at le|
|00000070| 61 73 74 20 68 61 73 20 | 32 20 73 65 72 69 61 6c |ast has |2 serial|
|00000080| 20 61 6e 64 20 31 20 70 | 61 72 61 6c 6c 65 6c 20 | and 1 p|arallel |
|00000090| 69 6e 74 65 72 66 61 63 | 65 73 2e 0a 54 68 65 73 |interfac|es..Thes|
|000000a0| 65 20 69 6e 74 65 72 66 | 61 63 65 73 20 61 72 65 |e interf|aces are|
|000000b0| 20 73 70 65 63 69 61 6c | 20 64 65 76 69 63 65 73 | special| devices|
|000000c0| 20 61 6e 64 20 61 72 65 | 20 6d 61 70 70 65 64 20 | and are| mapped |
|000000d0| 61 73 20 66 6f 6c 6c 6f | 77 73 3a 0a 5c 62 65 67 |as follo|ws:.\beg|
|000000e0| 69 6e 20 7b 69 74 65 6d | 69 7a 65 7d 0a 5c 69 74 |in {item|ize}.\it|
|000000f0| 65 6d 20 24 2f 64 65 76 | 2f 74 74 79 53 30 20 2d |em $/dev|/ttyS0 -|
|00000100| 20 2f 64 65 76 2f 74 74 | 79 53 7b 5c 62 66 20 6e | /dev/tt|yS{\bf n|
|00000110| 7d 24 5c 5c 0a 74 68 65 | 73 65 20 61 72 65 20 74 |}$\\.the|se are t|
|00000120| 68 65 20 52 53 32 33 32 | 20 73 65 72 69 61 6c 20 |he RS232| serial |
|00000130| 64 65 76 69 63 65 73 20 | 30 2d 7b 5c 62 66 20 6e |devices |0-{\bf n|
|00000140| 7d 20 77 68 65 72 65 20 | 7b 5c 62 66 20 6e 7d 20 |} where |{\bf n} |
|00000150| 64 65 70 65 6e 64 73 20 | 6f 6e 20 79 6f 75 72 20 |depends |on your |
|00000160| 68 61 72 64 77 61 72 65 | 2e 0a 5c 69 74 65 6d 20 |hardware|..\item |
|00000170| 24 2f 64 65 76 2f 63 75 | 61 30 20 2d 20 2f 64 65 |$/dev/cu|a0 - /de|
|00000180| 76 2f 63 75 61 7b 5c 62 | 66 20 6e 7d 24 5c 5c 0a |v/cua{\b|f n}$\\.|
|00000190| 74 68 65 73 65 20 61 72 | 65 20 74 68 65 20 52 53 |these ar|e the RS|
|000001a0| 32 33 32 20 73 65 72 69 | 61 6c 20 64 65 76 69 63 |232 seri|al devic|
|000001b0| 65 73 20 30 2d 7b 5c 62 | 66 20 6e 7d 20 77 68 65 |es 0-{\b|f n} whe|
|000001c0| 72 65 20 7b 5c 62 66 20 | 6e 7d 20 64 65 70 65 6e |re {\bf |n} depen|
|000001d0| 64 73 20 6f 6e 20 79 6f | 75 72 20 68 61 72 64 77 |ds on yo|ur hardw|
|000001e0| 61 72 65 2e 0a 5c 69 74 | 65 6d 20 24 2f 64 65 76 |are..\it|em $/dev|
|000001f0| 2f 6c 70 30 20 2d 20 2f | 64 65 76 2f 6c 70 7b 5c |/lp0 - /|dev/lp{\|
|00000200| 62 66 20 6e 7d 24 5c 5c | 0a 74 68 65 73 65 20 61 |bf n}$\\|.these a|
|00000210| 72 65 20 74 68 65 20 70 | 61 72 61 6c 6c 65 6c 20 |re the p|arallel |
|00000220| 64 65 76 69 63 65 73 20 | 30 2d 7b 5c 62 66 20 6e |devices |0-{\bf n|
|00000230| 7d 20 77 68 65 72 65 20 | 7b 5c 62 66 20 6e 7d 20 |} where |{\bf n} |
|00000240| 64 65 70 65 6e 64 73 20 | 6f 6e 20 79 6f 75 72 20 |depends |on your |
|00000250| 68 61 72 64 77 61 72 65 | 2e 0a 5c 69 74 65 6d 20 |hardware|..\item |
|00000260| 24 2f 64 65 76 2f 6a 73 | 30 20 2d 20 2f 64 65 76 |$/dev/js|0 - /dev|
|00000270| 2f 6a 73 7b 5c 62 66 20 | 6e 7d 24 5c 5c 0a 74 68 |/js{\bf |n}$\\.th|
|00000280| 65 73 65 20 61 72 65 20 | 74 68 65 20 6a 6f 79 73 |ese are |the joys|
|00000290| 74 69 63 6b 20 64 65 76 | 69 63 65 73 20 30 2d 7b |tick dev|ices 0-{|
|000002a0| 5c 62 66 20 6e 7d 20 77 | 68 65 72 65 20 24 20 30 |\bf n} w|here $ 0|
|000002b0| 3c 3d 20 7b 5c 62 66 20 | 6e 7d 20 3c 3d 20 31 20 |<= {\bf |n} <= 1 |
|000002c0| 24 2e 0a 5c 65 6e 64 20 | 7b 69 74 65 6d 69 7a 65 |$..\end |{itemize|
|000002d0| 7d 0a 0a 54 68 65 20 64 | 69 66 66 65 72 65 6e 63 |}..The d|ifferenc|
|000002e0| 65 20 62 65 74 77 65 65 | 6e 20 74 68 65 20 24 2f |e betwee|n the $/|
|000002f0| 64 65 76 2f 74 74 79 53 | 2a 24 20 61 6e 64 20 24 |dev/ttyS|*$ and $|
|00000300| 2f 64 65 76 2f 63 75 61 | 2a 24 20 64 65 76 69 63 |/dev/cua|*$ devic|
|00000310| 65 73 20 69 73 20 68 6f | 77 0a 61 20 63 61 6c 6c |es is ho|w.a call|
|00000320| 20 74 6f 20 6f 70 65 6e | 28 29 20 69 73 20 68 61 | to open|() is ha|
|00000330| 6e 64 6c 65 64 2e 20 54 | 68 65 20 24 2f 64 65 76 |ndled. T|he $/dev|
|00000340| 2f 63 75 61 2a 24 20 64 | 65 76 69 63 65 73 20 61 |/cua*$ d|evices a|
|00000350| 72 65 20 73 75 70 70 6f | 73 65 64 20 74 6f 20 62 |re suppo|sed to b|
|00000360| 65 20 75 73 65 64 0a 61 | 73 20 63 61 6c 6c 6f 75 |e used.a|s callou|
|00000370| 74 20 64 65 76 69 63 65 | 73 20 61 6e 64 20 74 68 |t device|s and th|
|00000380| 75 73 20 67 65 74 20 6f | 74 68 65 72 20 64 65 66 |us get o|ther def|
|00000390| 61 75 6c 74 20 73 65 74 | 74 69 6e 67 73 20 62 79 |ault set|tings by|
|000003a0| 20 61 20 63 61 6c 6c 20 | 74 6f 20 6f 70 65 6e 28 | a call |to open(|
|000003b0| 29 0a 74 68 61 6e 20 74 | 68 65 20 24 2f 64 65 76 |).than t|he $/dev|
|000003c0| 2f 74 74 79 53 2a 24 20 | 64 65 76 69 63 65 73 20 |/ttyS*$ |devices |
|000003d0| 77 68 69 63 68 20 77 69 | 6c 6c 20 62 65 20 69 6e |which wi|ll be in|
|000003e0| 69 74 61 6c 69 7a 65 64 | 20 66 6f 72 20 69 6e 63 |italized| for inc|
|000003f0| 6f 6d 69 6e 67 20 61 6e | 64 0a 6f 75 74 67 6f 69 |oming an|d.outgoi|
|00000400| 6e 67 20 63 61 6c 6c 73 | 2e 20 42 79 20 64 65 66 |ng calls|. By def|
|00000410| 61 75 6c 74 20 74 68 65 | 20 64 65 76 69 63 65 73 |ault the| devices|
|00000420| 20 61 72 65 20 63 6f 6e | 74 72 6f 6c 6c 69 6e 67 | are con|trolling|
|00000430| 20 64 65 76 69 63 65 73 | 20 66 6f 72 20 74 68 65 | devices| for the|
|00000440| 0a 70 72 6f 63 65 73 73 | 20 74 68 61 74 20 6f 70 |.process| that op|
|00000450| 65 6e 65 64 20 74 68 65 | 6d 2e 0a 4e 6f 72 6d 61 |ened the|m..Norma|
|00000460| 6c 6c 79 20 69 6f 63 74 | 6c 28 29 20 72 65 71 75 |lly ioct|l() requ|
|00000470| 65 73 74 73 20 73 68 6f | 75 6c 64 20 68 61 6e 64 |ests sho|uld hand|
|00000480| 6c 65 20 61 6c 6c 20 74 | 68 65 73 65 20 73 70 65 |le all t|hese spe|
|00000490| 63 69 61 6c 20 64 65 76 | 69 63 65 73 2c 20 62 75 |cial dev|ices, bu|
|000004a0| 74 0a 50 4f 53 49 58 20 | 70 72 65 66 65 72 72 65 |t.POSIX |preferre|
|000004b0| 64 20 74 6f 20 64 65 66 | 69 6e 65 20 6e 65 77 20 |d to def|ine new |
|000004c0| 66 75 6e 63 74 69 6f 6e | 73 20 74 6f 20 68 61 6e |function|s to han|
|000004d0| 64 6c 65 20 61 73 79 6e | 63 68 72 6f 6e 6f 75 73 |dle asyn|chronous|
|000004e0| 0a 74 65 72 6d 69 6e 61 | 6c 73 20 68 65 61 76 69 |.termina|ls heavi|
|000004f0| 6c 79 20 64 65 70 65 6e | 64 69 6e 67 20 6f 6e 20 |ly depen|ding on |
|00000500| 74 68 65 20 73 74 72 75 | 63 74 20 74 65 72 6d 69 |the stru|ct termi|
|00000510| 6f 73 2e 20 42 6f 74 68 | 20 6d 65 74 68 6f 64 73 |os. Both| methods|
|00000520| 20 72 65 71 75 69 72 65 | 0a 69 6e 63 6c 75 64 69 | require|.includi|
|00000530| 6e 67 20 24 3c 74 65 72 | 6d 69 6f 73 2e 68 3e 24 |ng $<ter|mios.h>$|
|00000540| 2e 5c 5c 0a 5c 62 65 67 | 69 6e 20 7b 65 6e 75 6d |.\\.\beg|in {enum|
|00000550| 65 72 61 74 65 7d 0a 5c | 69 74 65 6d 20 6d 65 74 |erate}.\|item met|
|00000560| 68 6f 64 20 69 6f 63 74 | 6c 3a 5c 5c 0a 54 43 53 |hod ioct|l:\\.TCS|
|00000570| 42 52 4b 2c 20 54 43 53 | 42 52 4b 50 2c 20 54 43 |BRK, TCS|BRKP, TC|
|00000580| 47 45 54 41 20 28 67 65 | 74 20 61 74 74 72 69 62 |GETA (ge|t attrib|
|00000590| 75 74 65 73 29 2c 20 54 | 43 53 45 54 41 20 28 73 |utes), T|CSETA (s|
|000005a0| 65 74 20 61 74 74 72 69 | 62 75 74 65 73 29 5c 5c |et attri|butes)\\|
|000005b0| 0a 54 65 72 6d 69 6e 61 | 6c 20 49 2f 4f 20 63 6f |.Termina|l I/O co|
|000005c0| 6e 74 72 6f 6c 20 28 54 | 49 4f 43 29 20 72 65 71 |ntrol (T|IOC) req|
|000005d0| 75 65 73 74 73 3a 5c 5c | 0a 54 49 4f 43 47 53 4f |uests:\\|.TIOCGSO|
|000005e0| 46 54 43 41 52 20 28 73 | 65 74 20 73 6f 66 74 20 |FTCAR (s|et soft |
|000005f0| 63 61 72 72 69 65 72 29 | 2c 20 54 49 4f 43 53 53 |carrier)|, TIOCSS|
|00000600| 4f 46 54 43 41 52 20 28 | 67 65 74 20 73 6f 66 74 |OFTCAR (|get soft|
|00000610| 20 63 61 72 72 69 65 72 | 29 2c 20 0a 54 49 4f 43 | carrier|), .TIOC|
|00000620| 53 43 54 54 59 20 28 73 | 65 74 20 63 6f 6e 74 72 |SCTTY (s|et contr|
|00000630| 6f 6c 6c 69 6e 67 20 74 | 74 79 29 2c 20 0a 54 49 |olling t|ty), .TI|
|00000640| 4f 43 4d 47 45 54 20 28 | 67 65 74 20 6d 6f 64 65 |OCMGET (|get mode|
|00000650| 6d 6c 69 6e 65 73 29 2c | 20 54 49 4f 43 4d 53 45 |mlines),| TIOCMSE|
|00000660| 54 20 28 73 65 74 20 6d | 6f 64 65 6d 6c 69 6e 65 |T (set m|odemline|
|00000670| 73 29 2c 20 0a 54 49 4f | 43 47 53 45 52 49 41 4c |s), .TIO|CGSERIAL|
|00000680| 2c 20 54 49 4f 43 53 53 | 45 52 49 41 4c 2c 20 54 |, TIOCSS|ERIAL, T|
|00000690| 49 4f 43 53 45 52 43 4f | 4e 46 49 47 2c 20 54 49 |IOCSERCO|NFIG, TI|
|000006a0| 4f 43 53 45 52 47 57 49 | 4c 44 2c 20 54 49 4f 43 |OCSERGWI|LD, TIOC|
|000006b0| 53 45 52 53 57 49 4c 44 | 2c 20 0a 54 49 4f 43 53 |SERSWILD|, .TIOCS|
|000006c0| 45 52 47 53 54 52 55 43 | 54 2c 20 54 49 4f 43 4d |ERGSTRUC|T, TIOCM|
|000006d0| 42 49 53 2c 20 54 49 4f | 43 4d 42 49 43 2c 20 2e |BIS, TIO|CMBIC, .|
|000006e0| 2e 2e 5c 5c 0a 5c 69 74 | 65 6d 20 6d 65 74 68 6f |..\\.\it|em metho|
|000006f0| 64 20 50 4f 53 49 58 3a | 5c 5c 0a 74 63 67 65 74 |d POSIX:|\\.tcget|
|00000700| 61 74 74 72 28 29 2c 20 | 74 63 73 65 74 61 74 74 |attr(), |tcsetatt|
|00000710| 72 28 29 2c 20 74 63 73 | 65 6e 64 62 72 65 61 6b |r(), tcs|endbreak|
|00000720| 28 29 2c 20 74 63 64 72 | 61 69 6e 28 29 2c 20 74 |(), tcdr|ain(), t|
|00000730| 63 66 6c 75 73 68 28 29 | 2c 20 74 63 66 6c 6f 77 |cflush()|, tcflow|
|00000740| 28 29 2c 20 0a 74 63 67 | 65 74 70 67 72 70 28 29 |(), .tcg|etpgrp()|
|00000750| 2c 20 74 63 73 65 74 70 | 67 72 70 28 29 5c 5c 0a |, tcsetp|grp()\\.|
|00000760| 63 66 73 65 74 69 73 70 | 65 65 64 28 29 2c 20 63 |cfsetisp|eed(), c|
|00000770| 66 67 65 74 69 73 70 65 | 65 64 28 29 2c 20 63 66 |fgetispe|ed(), cf|
|00000780| 73 65 74 6f 73 70 65 65 | 64 28 29 2c 20 63 66 67 |setospee|d(), cfg|
|00000790| 65 74 6f 73 70 65 65 64 | 28 29 5c 5c 0a 5c 69 74 |etospeed|()\\.\it|
|000007a0| 65 6d 20 6f 74 68 65 72 | 20 6d 65 74 68 6f 64 73 |em other| methods|
|000007b0| 3a 5c 5c 0a 6f 75 74 62 | 2c 69 6e 62 20 66 6f 72 |:\\.outb|,inb for|
|000007c0| 20 68 61 72 64 77 61 72 | 65 20 6e 65 61 72 20 70 | hardwar|e near p|
|000007d0| 72 6f 67 72 61 6d 6d 69 | 6e 67 20 6c 69 6b 65 20 |rogrammi|ng like |
|000007e0| 75 73 69 6e 67 20 74 68 | 65 20 70 72 69 6e 74 65 |using th|e printe|
|000007f0| 72 0a 70 6f 72 74 20 6e | 6f 74 20 66 6f 72 20 61 |r.port n|ot for a|
|00000800| 20 70 72 69 6e 74 65 72 | 2e 5c 5c 0a 5c 65 6e 64 | printer|.\\.\end|
|00000810| 20 7b 65 6e 75 6d 65 72 | 61 74 65 7d 0a 5c 63 6c | {enumer|ate}.\cl|
|00000820| 65 61 72 70 61 67 65 0a | 0a 5c 73 65 63 74 69 6f |earpage.|.\sectio|
|00000830| 6e 20 7b 4d 6f 75 73 65 | 20 50 72 6f 67 72 61 6d |n {Mouse| Program|
|00000840| 6d 69 6e 67 7d 0a 41 20 | 6d 6f 75 73 65 20 69 73 |ming}.A |mouse is|
|00000850| 20 65 69 74 68 65 72 20 | 63 6f 6e 6e 65 63 74 65 | either |connecte|
|00000860| 64 20 74 6f 20 61 20 73 | 65 72 69 61 6c 20 70 6f |d to a s|erial po|
|00000870| 72 74 20 6f 72 20 64 69 | 72 65 63 74 6c 79 20 74 |rt or di|rectly t|
|00000880| 6f 20 74 68 65 0a 41 54 | 20 62 75 73 20 61 6e 64 |o the.AT| bus and|
|00000890| 20 64 69 66 66 65 72 65 | 6e 74 20 74 79 70 65 73 | differe|nt types|
|000008a0| 20 6f 66 20 6d 6f 75 73 | 65 20 73 65 6e 64 20 64 | of mous|e send d|
|000008b0| 69 73 74 69 6e 63 74 20 | 6b 69 6e 64 73 20 6f 66 |istinct |kinds of|
|000008c0| 20 64 61 74 61 2c 20 77 | 68 69 63 68 20 6d 61 6b | data, w|hich mak|
|000008d0| 65 73 0a 6d 6f 75 73 65 | 20 70 72 6f 67 72 61 6d |es.mouse| program|
|000008e0| 6d 69 6e 67 20 61 20 62 | 69 74 20 68 61 72 64 65 |ming a b|it harde|
|000008f0| 72 2e 0a 42 75 74 2c 20 | 41 6e 64 72 65 77 20 48 |r..But, |Andrew H|
|00000900| 61 79 6c 65 74 74 20 77 | 61 73 20 73 6f 20 6b 69 |aylett w|as so ki|
|00000910| 6e 64 20 61 73 20 74 6f | 20 70 75 74 20 61 20 67 |nd as to| put a g|
|00000920| 65 6e 65 72 6f 75 73 20 | 63 6f 70 79 72 69 67 68 |enerous |copyrigh|
|00000930| 74 20 6f 6e 20 68 69 73 | 0a 73 65 6c 65 63 74 69 |t on his|.selecti|
|00000940| 6f 6e 20 70 72 6f 67 72 | 61 6d 20 77 68 69 63 68 |on progr|am which|
|00000950| 20 6d 65 61 6e 73 20 79 | 6f 75 20 63 61 6e 20 75 | means y|ou can u|
|00000960| 73 65 20 68 69 73 20 6d | 6f 75 73 65 20 72 6f 75 |se his m|ouse rou|
|00000970| 74 69 6e 65 73 20 66 6f | 72 0a 79 6f 75 72 20 6f |tines fo|r.your o|
|00000980| 77 6e 20 70 72 6f 67 72 | 61 6d 73 2e 20 49 6e 63 |wn progr|ams. Inc|
|00000990| 6c 75 64 65 64 20 69 6e | 20 74 68 69 73 20 67 75 |luded in| this gu|
|000009a0| 69 64 65 20 79 6f 75 20 | 63 61 6e 20 66 69 6e 64 |ide you |can find|
|000009b0| 20 74 68 65 20 70 72 65 | 2d 72 65 6c 65 61 73 65 | the pre|-release|
|000009c0| 0a 6f 66 20 73 65 6c 65 | 63 74 69 6f 6e 2d 31 2e |.of sele|ction-1.|
|000009d0| 38 20 77 69 74 68 20 74 | 68 65 20 43 4f 50 59 52 |8 with t|he COPYR|
|000009e0| 49 47 48 54 20 6e 6f 74 | 69 63 65 2e 0a 58 31 31 |IGHT not|ice..X11|
|000009f0| 20 61 6c 72 65 61 64 79 | 20 6f 66 66 65 72 73 20 | already| offers |
|00000a00| 61 20 63 6f 6d 66 6f 72 | 74 61 62 6c 65 20 6d 6f |a comfor|table mo|
|00000a10| 75 73 65 20 41 50 49 2c | 20 73 6f 20 41 6e 64 72 |use API,| so Andr|
|00000a20| 65 77 27 73 20 72 6f 75 | 74 69 6e 65 73 20 73 68 |ew's rou|tines sh|
|00000a30| 6f 75 6c 64 0a 62 65 20 | 75 73 65 64 20 66 6f 72 |ould.be |used for|
|00000a40| 20 6e 6f 6e 2d 58 31 31 | 20 61 70 70 6c 69 63 61 | non-X11| applica|
|00000a50| 74 69 6f 6e 73 20 6f 6e | 6c 79 2e 5c 5c 0a 59 6f |tions on|ly.\\.Yo|
|00000a60| 75 20 6f 6e 6c 79 20 6e | 65 65 64 20 74 68 65 20 |u only n|eed the |
|00000a70| 6d 6f 64 75 6c 65 73 20 | 6d 6f 75 73 65 2e 63 20 |modules |mouse.c |
|00000a80| 61 6e 64 20 6d 6f 75 73 | 65 2e 68 20 66 72 6f 6d |and mous|e.h from|
|00000a90| 20 74 68 65 20 73 65 6c | 65 63 74 69 6f 6e 20 70 | the sel|ection p|
|00000aa0| 61 63 6b 61 67 65 2e 0a | 54 6f 20 67 65 74 20 6d |ackage..|To get m|
|00000ab0| 6f 75 73 65 20 65 76 65 | 6e 74 73 20 79 6f 75 20 |ouse eve|nts you |
|00000ac0| 62 61 73 69 63 61 6c 6c | 79 20 68 61 76 65 20 74 |basicall|y have t|
|00000ad0| 6f 20 63 61 6c 6c 20 6d | 73 5c 5f 69 6e 69 74 28 |o call m|s\_init(|
|00000ae0| 29 20 61 6e 64 20 67 65 | 74 5c 5f 6d 73 5c 5f 65 |) and ge|t\_ms\_e|
|00000af0| 76 65 6e 74 28 29 2e 0a | 6d 73 5c 5f 69 6e 69 74 |vent()..|ms\_init|
|00000b00| 20 6e 65 65 64 73 20 74 | 68 65 20 66 6f 6c 6c 6f | needs t|he follo|
|00000b10| 77 69 6e 67 20 31 30 20 | 61 72 67 75 6d 65 6e 74 |wing 10 |argument|
|00000b20| 73 3a 5c 5c 0a 5c 62 65 | 67 69 6e 20 7b 65 6e 75 |s:\\.\be|gin {enu|
|00000b30| 6d 65 72 61 74 65 7d 0a | 5c 69 74 65 6d 20 7b 5c |merate}.|\item {\|
|00000b40| 69 74 20 69 6e 74 20 61 | 63 63 65 6c 65 72 61 74 |it int a|ccelerat|
|00000b50| 69 6f 6e 7d 5c 5c 0a 69 | 73 20 74 68 65 20 61 63 |ion}\\.i|s the ac|
|00000b60| 63 65 6c 65 72 61 74 69 | 6f 6e 20 66 61 63 74 6f |celerati|on facto|
|00000b70| 72 2e 20 49 66 20 79 6f | 75 20 6d 6f 76 65 20 74 |r. If yo|u move t|
|00000b80| 68 65 20 6d 6f 75 73 65 | 20 6d 6f 72 65 20 74 68 |he mouse| more th|
|00000b90| 61 6e 0a 7b 5c 69 74 20 | 64 65 6c 74 61 7d 20 70 |an.{\it |delta} p|
|00000ba0| 69 78 65 6c 73 2c 20 6d | 6f 74 69 6f 6e 20 62 65 |ixels, m|otion be|
|00000bb0| 63 6f 6d 65 73 20 66 61 | 73 74 65 72 20 64 65 70 |comes fa|ster dep|
|00000bc0| 65 6e 64 69 6e 67 20 6f | 6e 20 74 68 69 73 20 76 |ending o|n this v|
|00000bd0| 61 6c 75 65 2e 0a 5c 69 | 74 65 6d 20 7b 5c 69 74 |alue..\i|tem {\it|
|00000be0| 20 69 6e 74 20 62 61 75 | 64 7d 20 5c 5c 0a 69 73 | int bau|d} \\.is|
|00000bf0| 20 74 68 65 20 62 70 73 | 20 72 61 74 65 20 79 6f | the bps| rate yo|
|00000c00| 75 72 20 6d 6f 75 73 65 | 20 75 73 65 73 20 28 6e |ur mouse| uses (n|
|00000c10| 6f 72 6d 61 6c 6c 79 20 | 31 32 30 30 29 2e 0a 5c |ormally |1200)..\|
|00000c20| 69 74 65 6d 20 7b 5c 69 | 74 20 69 6e 74 20 64 65 |item {\i|t int de|
|00000c30| 6c 74 61 7d 5c 5c 0a 74 | 68 69 73 20 69 73 20 74 |lta}\\.t|his is t|
|00000c40| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 70 69 78 |he numbe|r of pix|
|00000c50| 65 6c 73 20 74 68 61 74 | 20 79 6f 75 20 68 61 76 |els that| you hav|
|00000c60| 65 20 74 6f 20 6d 6f 76 | 65 20 74 68 65 20 6d 6f |e to mov|e the mo|
|00000c70| 75 73 65 20 62 65 66 6f | 72 65 0a 74 68 65 20 61 |use befo|re.the a|
|00000c80| 63 63 65 6c 65 72 61 74 | 69 6f 6e 20 73 74 61 72 |ccelerat|ion star|
|00000c90| 74 73 2e 0a 5c 69 74 65 | 6d 20 7b 5c 69 74 20 63 |ts..\ite|m {\it c|
|00000ca0| 68 61 72 20 2a 64 65 76 | 69 63 65 7d 5c 5c 0a 69 |har *dev|ice}\\.i|
|00000cb0| 73 20 74 68 65 20 6e 61 | 6d 65 20 6f 66 20 79 6f |s the na|me of yo|
|00000cc0| 75 72 20 6d 6f 75 73 65 | 20 64 65 76 69 63 65 20 |ur mouse| device |
|00000cd0| 28 65 2e 67 2e 20 2f 64 | 65 76 2f 6d 6f 75 73 65 |(e.g. /d|ev/mouse|
|00000ce0| 29 2e 0a 5c 69 74 65 6d | 20 7b 5c 69 74 20 69 6e |)..\item| {\it in|
|00000cf0| 74 20 74 6f 67 67 6c 65 | 7d 5c 5c 0a 74 6f 67 67 |t toggle|}\\.togg|
|00000d00| 6c 65 20 74 68 65 20 44 | 54 52 2c 20 52 54 53 20 |le the D|TR, RTS |
|00000d10| 6f 72 20 62 6f 74 68 20 | 44 54 52 20 61 6e 64 20 |or both |DTR and |
|00000d20| 52 54 53 20 6d 6f 75 73 | 65 20 6d 6f 64 65 6d 20 |RTS mous|e modem |
|00000d30| 6c 69 6e 65 73 20 6f 6e | 20 0a 69 6e 69 74 69 61 |lines on| .initia|
|00000d40| 6c 69 7a 61 74 69 6f 6e | 20 28 6e 6f 72 6d 61 6c |lization| (normal|
|00000d50| 6c 79 20 30 29 2e 0a 5c | 69 74 65 6d 20 7b 5c 69 |ly 0)..\|item {\i|
|00000d60| 74 20 69 6e 74 20 73 61 | 6d 70 6c 65 7d 5c 5c 0a |t int sa|mple}\\.|
|00000d70| 74 68 65 20 72 65 73 6f | 6c 75 74 69 6f 6e 20 28 |the reso|lution (|
|00000d80| 64 70 69 29 20 6f 66 20 | 79 6f 75 72 20 6d 6f 75 |dpi) of |your mou|
|00000d90| 73 65 20 28 6e 6f 72 6d | 61 6c 6c 79 20 31 30 30 |se (norm|ally 100|
|00000da0| 29 2e 0a 5c 69 74 65 6d | 20 7b 5c 69 74 20 6d 6f |)..\item| {\it mo|
|00000db0| 75 73 65 5c 5f 74 79 70 | 65 20 6d 6f 75 73 65 7d |use\_typ|e mouse}|
|00000dc0| 5c 5c 0a 74 68 65 20 69 | 64 65 6e 74 69 66 69 65 |\\.the i|dentifie|
|00000dd0| 72 20 6f 66 20 74 68 65 | 20 63 6f 6e 6e 65 63 74 |r of the| connect|
|00000de0| 65 64 20 6d 6f 75 73 65 | 20 6c 69 6b 65 20 50 5c |ed mouse| like P\|
|00000df0| 5f 4d 53 43 20 28 4d 6f | 75 73 65 20 53 79 73 74 |_MSC (Mo|use Syst|
|00000e00| 65 6d 73 20 43 6f 72 70 | 2e 29 0a 66 6f 72 20 6d |ems Corp|.).for m|
|00000e10| 79 20 6d 6f 75 73 65 20 | 3b 29 2e 0a 5c 69 74 65 |y mouse |;)..\ite|
|00000e20| 6d 20 7b 5c 69 74 20 69 | 6e 74 20 73 6c 61 63 6b |m {\it i|nt slack|
|00000e30| 7d 5c 5c 0a 61 6d 6f 75 | 6e 74 20 6f 66 20 73 6c |}\\.amou|nt of sl|
|00000e40| 61 63 6b 20 66 6f 72 20 | 77 72 61 70 61 72 6f 75 |ack for |wraparou|
|00000e50| 6e 64 20 77 68 69 63 68 | 20 6d 65 61 6e 73 20 69 |nd which| means i|
|00000e60| 66 20 73 6c 61 63 6b 20 | 69 73 20 2d 31 20 61 20 |f slack |is -1 a |
|00000e70| 74 72 79 20 74 6f 20 6d | 6f 76 65 20 74 68 65 0a |try to m|ove the.|
|00000e80| 6d 6f 75 73 65 20 6f 76 | 65 72 20 74 68 65 20 73 |mouse ov|er the s|
|00000e90| 63 72 65 65 6e 20 62 6f | 72 64 65 72 20 77 69 6c |creen bo|rder wil|
|00000ea0| 6c 20 6c 65 61 76 65 20 | 74 68 65 20 6d 6f 75 73 |l leave |the mous|
|00000eb0| 65 20 61 74 20 74 68 65 | 20 62 6f 72 64 65 72 2e |e at the| border.|
|00000ec0| 0a 56 61 6c 75 65 73 20 | 24 3e 3d 24 20 30 20 6d |.Values |$>=$ 0 m|
|00000ed0| 65 61 6e 20 74 68 61 74 | 20 74 68 65 20 6d 6f 75 |ean that| the mou|
|00000ee0| 73 65 20 63 75 72 73 6f | 72 20 77 69 6c 6c 20 77 |se curso|r will w|
|00000ef0| 72 61 70 20 74 6f 20 74 | 68 65 20 6f 74 68 65 72 |rap to t|he other|
|00000f00| 20 65 6e 64 20 61 66 74 | 65 72 0a 6d 6f 76 69 6e | end aft|er.movin|
|00000f10| 67 20 74 68 65 20 6d 6f | 75 73 65 20 7b 5c 69 74 |g the mo|use {\it|
|00000f20| 20 73 6c 61 63 6b 7d 20 | 70 69 78 65 6c 73 20 61 | slack} |pixels a|
|00000f30| 67 61 69 6e 73 74 20 74 | 68 65 20 62 6f 72 64 65 |gainst t|he borde|
|00000f40| 72 2e 0a 5c 69 74 65 6d | 20 7b 5c 69 74 20 69 6e |r..\item| {\it in|
|00000f50| 74 20 6d 61 78 78 7d 5c | 5c 0a 74 68 65 20 72 65 |t maxx}\|\.the re|
|00000f60| 73 6f 6c 75 74 69 6f 6e | 20 6f 66 20 79 6f 75 72 |solution| of your|
|00000f70| 20 63 75 72 72 65 6e 74 | 20 74 65 72 6d 69 6e 61 | current| termina|
|00000f80| 6c 20 69 6e 20 78 20 64 | 69 72 65 63 74 69 6f 6e |l in x d|irection|
|00000f90| 2e 20 57 69 74 68 20 74 | 68 65 20 0a 64 65 66 61 |. With t|he .defa|
|00000fa0| 75 6c 74 20 66 6f 6e 74 | 2c 20 61 20 63 68 61 72 |ult font|, a char|
|00000fb0| 20 69 73 20 31 30 20 70 | 69 78 65 6c 73 20 77 69 | is 10 p|ixels wi|
|00000fc0| 64 65 2c 20 61 6e 64 20 | 74 68 65 72 65 66 6f 72 |de, and |therefor|
|00000fd0| 65 20 74 68 65 20 6f 76 | 65 72 61 6c 6c 0a 78 20 |e the ov|erall.x |
|00000fe0| 73 63 72 65 65 6e 20 72 | 65 73 6f 6c 75 74 69 6f |screen r|esolutio|
|00000ff0| 6e 20 69 73 20 31 30 2a | 38 30 2d 31 2e 0a 5c 69 |n is 10*|80-1..\i|
|00001000| 74 65 6d 20 7b 5c 69 74 | 20 69 6e 74 20 6d 61 78 |tem {\it| int max|
|00001010| 79 7d 5c 5c 0a 74 68 65 | 20 72 65 73 6f 6c 75 74 |y}\\.the| resolut|
|00001020| 69 6f 6e 20 6f 66 20 79 | 6f 75 72 20 63 75 72 72 |ion of y|our curr|
|00001030| 65 6e 74 20 74 65 72 6d | 69 6e 61 6c 20 69 6e 20 |ent term|inal in |
|00001040| 79 20 64 69 72 65 63 74 | 69 6f 6e 2e 20 57 69 74 |y direct|ion. Wit|
|00001050| 68 20 74 68 65 20 0a 64 | 65 66 61 75 6c 74 20 66 |h the .d|efault f|
|00001060| 6f 6e 74 2c 20 61 20 63 | 68 61 72 20 69 73 20 31 |ont, a c|har is 1|
|00001070| 32 20 70 69 78 65 6c 73 | 20 68 69 67 68 20 61 6e |2 pixels| high an|
|00001080| 64 20 74 68 65 72 65 66 | 6f 72 65 20 74 68 65 20 |d theref|ore the |
|00001090| 6f 76 65 72 61 6c 6c 0a | 79 20 73 63 72 65 65 6e |overall.|y screen|
|000010a0| 20 72 65 73 6f 6c 75 74 | 69 6f 6e 20 69 73 20 31 | resolut|ion is 1|
|000010b0| 32 2a 32 35 2d 31 2e 0a | 5c 65 6e 64 20 7b 65 6e |2*25-1..|\end {en|
|000010c0| 75 6d 65 72 61 74 65 7d | 0a 67 65 74 5c 5f 6d 73 |umerate}|.get\_ms|
|000010d0| 5c 5f 65 76 65 6e 74 28 | 29 20 6a 75 73 74 20 6e |\_event(|) just n|
|000010e0| 65 65 64 73 20 61 20 70 | 6f 69 6e 74 65 72 20 74 |eeds a p|ointer t|
|000010f0| 6f 20 61 20 73 74 72 75 | 63 74 20 6d 73 5c 5f 65 |o a stru|ct ms\_e|
|00001100| 76 65 6e 74 2e 0a 49 66 | 20 67 65 74 5c 5f 6d 73 |vent..If| get\_ms|
|00001110| 5c 5f 65 76 65 6e 74 28 | 29 20 72 65 74 75 72 6e |\_event(|) return|
|00001120| 73 20 2d 31 2c 20 61 6e | 20 65 72 72 6f 72 20 6f |s -1, an| error o|
|00001130| 63 63 75 72 65 64 2e 20 | 4f 6e 20 73 75 63 63 65 |ccured. |On succe|
|00001140| 73 73 2c 20 69 74 0a 72 | 65 74 75 72 6e 73 20 30 |ss, it.r|eturns 0|
|00001150| 2c 20 61 6e 64 20 74 68 | 65 20 73 74 72 75 63 74 |, and th|e struct|
|00001160| 20 6d 73 5c 5f 65 76 65 | 6e 74 20 77 69 6c 6c 20 | ms\_eve|nt will |
|00001170| 63 6f 6e 74 61 69 6e 20 | 74 68 65 20 61 63 74 75 |contain |the actu|
|00001180| 61 6c 20 6d 6f 75 73 65 | 20 73 74 61 74 65 2e 0a |al mouse| state..|
|00001190| 0a 0a 5c 73 65 63 74 69 | 6f 6e 20 7b 4d 6f 64 65 |..\secti|on {Mode|
|000011a0| 6d 20 50 72 6f 67 72 61 | 6d 6d 69 6e 67 7d 0a 53 |m Progra|mming}.S|
|000011b0| 65 65 20 65 78 61 6d 70 | 6c 65 20 6d 69 6e 69 74 |ee examp|le minit|
|000011c0| 65 72 6d 2e 63 5c 5c 0a | 55 73 65 20 74 65 72 6d |erm.c\\.|Use term|
|000011d0| 69 6f 73 20 74 6f 20 63 | 6f 6e 74 72 6f 6c 20 72 |ios to c|ontrol r|
|000011e0| 73 32 33 32 20 70 6f 72 | 74 2e 5c 5c 0a 55 73 65 |s232 por|t.\\.Use|
|000011f0| 20 48 61 79 65 73 20 43 | 6f 6d 6d 61 6e 64 73 20 | Hayes C|ommands |
|00001200| 74 6f 20 63 6f 6e 74 72 | 6f 6c 20 6d 6f 64 65 6d |to contr|ol modem|
|00001210| 2e 0a 0a 5c 73 65 63 74 | 69 6f 6e 20 7b 50 72 69 |...\sect|ion {Pri|
|00001220| 6e 74 65 72 20 50 72 6f | 67 72 61 6d 6d 69 6e 67 |nter Pro|gramming|
|00001230| 7d 0a 53 65 65 20 65 78 | 61 6d 70 6c 65 20 63 68 |}.See ex|ample ch|
|00001240| 65 63 6b 6c 70 2e 63 5c | 5c 0a 44 6f 6e 27 74 20 |ecklp.c\|\.Don't |
|00001250| 75 73 65 20 74 65 72 6d | 69 6f 73 20 74 6f 20 63 |use term|ios to c|
|00001260| 6f 6e 74 72 6f 6c 20 70 | 72 69 6e 74 65 72 20 70 |ontrol p|rinter p|
|00001270| 6f 72 74 2e 0a 55 73 65 | 20 69 6f 63 74 6c 20 61 |ort..Use| ioctl a|
|00001280| 6e 64 20 69 6e 62 2f 6f | 75 74 62 20 69 66 20 6e |nd inb/o|utb if n|
|00001290| 65 63 65 73 73 61 72 79 | 2e 5c 5c 0a 55 73 65 20 |ecessary|.\\.Use |
|000012a0| 45 70 73 6f 6e 2c 20 50 | 6f 73 74 73 63 72 69 70 |Epson, P|ostscrip|
|000012b0| 74 2c 20 50 43 4c 2c 20 | 65 74 63 2e 20 63 6f 6d |t, PCL, |etc. com|
|000012c0| 6d 61 6e 64 73 20 74 6f | 20 63 6f 6e 74 72 6f 6c |mands to| control|
|000012d0| 20 70 72 69 6e 74 65 72 | 2e 5c 5c 0a 24 3c 6c 69 | printer|.\\.$<li|
|000012e0| 6e 75 78 2f 6c 70 2e 68 | 3e 24 5c 5c 0a 69 6f 63 |nux/lp.h|>$\\.ioc|
|000012f0| 74 6c 20 63 61 6c 6c 73 | 3a 20 4c 50 43 48 41 52 |tl calls|: LPCHAR|
|00001300| 2c 20 4c 50 54 49 4d 45 | 2c 20 4c 50 41 42 4f 52 |, LPTIME|, LPABOR|
|00001310| 54 2c 20 4c 50 53 45 54 | 49 52 51 2c 20 4c 50 47 |T, LPSET|IRQ, LPG|
|00001320| 45 54 49 52 51 2c 20 4c | 50 57 41 49 54 5c 5c 0a |ETIRQ, L|PWAIT\\.|
|00001330| 69 6e 62 2f 6f 75 74 62 | 20 66 6f 72 20 73 74 61 |inb/outb| for sta|
|00001340| 74 75 73 20 61 6e 64 20 | 63 6f 6e 74 72 6f 6c 20 |tus and |control |
|00001350| 70 6f 72 74 2e 0a 0a 5c | 73 65 63 74 69 6f 6e 20 |port...\|section |
|00001360| 7b 4a 6f 79 73 74 69 63 | 6b 20 50 72 6f 67 72 61 |{Joystic|k Progra|
|00001370| 6d 6d 69 6e 67 7d 0a 53 | 65 65 20 65 78 61 6d 70 |mming}.S|ee examp|
|00001380| 6c 65 20 6a 73 2e 63 20 | 69 6e 20 74 68 65 20 6a |le js.c |in the j|
|00001390| 6f 79 73 74 69 63 6b 20 | 6c 6f 61 64 61 62 6c 65 |oystick |loadable|
|000013a0| 20 6b 65 72 6e 65 6c 20 | 6d 6f 64 75 6c 65 20 70 | kernel |module p|
|000013b0| 61 63 6b 61 67 65 2e 5c | 5c 0a 24 3c 6c 69 6e 75 |ackage.\|\.$<linu|
|000013c0| 78 2f 6a 6f 79 73 74 69 | 63 6b 2e 68 3e 24 5c 5c |x/joysti|ck.h>$\\|
|000013d0| 0a 69 6f 63 74 6c 20 63 | 61 6c 6c 73 3a 20 4a 53 |.ioctl c|alls: JS|
|000013e0| 5c 5f 53 45 54 5c 5f 43 | 41 4c 2c 20 4a 53 5c 5f |\_SET\_C|AL, JS\_|
|000013f0| 47 45 54 5c 5f 43 41 4c | 2c 20 4a 53 5c 5f 53 45 |GET\_CAL|, JS\_SE|
|00001400| 54 5c 5f 54 49 4d 45 4f | 55 54 2c 20 4a 53 5c 5f |T\_TIMEO|UT, JS\_|
|00001410| 47 45 54 5c 5f 54 49 4d | 45 4f 55 54 2c 0a 4a 53 |GET\_TIM|EOUT,.JS|
|00001420| 5c 5f 53 45 54 5c 5f 54 | 49 4d 45 4c 49 4d 49 54 |\_SET\_T|IMELIMIT|
|00001430| 2c 20 4a 53 5c 5f 47 45 | 54 5c 5f 54 49 4d 45 4c |, JS\_GE|T\_TIMEL|
|00001440| 49 4d 49 54 2c 20 4a 53 | 5c 5f 47 45 54 5c 5f 41 |IMIT, JS|\_GET\_A|
|00001450| 4c 4c 2c 20 4a 53 5c 5f | 53 45 54 5c 5f 41 4c 4c |LL, JS\_|SET\_ALL|
|00001460| 2e 0a 41 20 72 65 61 64 | 20 6f 70 65 72 61 74 69 |..A read| operati|
|00001470| 6f 6e 20 6f 6e 20 2f 64 | 65 76 2f 6a 73 7b 5c 62 |on on /d|ev/js{\b|
|00001480| 66 20 6e 7d 20 77 69 6c | 6c 20 72 65 74 75 72 6e |f n} wil|l return|
|00001490| 20 74 68 65 20 73 74 72 | 75 63 74 20 4a 53 5c 5f | the str|uct JS\_|
|000014a0| 44 41 54 41 5c 5f 54 59 | 50 45 2e 0a 0a 5c 65 6e |DATA\_TY|PE...\en|
|000014b0| 64 69 6e 70 75 74 0a | |dinput. | |
+--------+-------------------------+-------------------------+--------+--------+